package com.example.ioc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ImportResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: ys
 * @create: 2019/9/21
 **/
@Controller
public class IocB {
    @Autowired
    IocA iocA;

    @RequestMapping("/helloIoc")
    @ResponseBody
    public String hello(){
        return iocA.a();
    }
//    @RequestMapping("/helloIoc1")
//    public Object testSpringUtil1() {
//        return IocC.getBean("testDemo");
//    }
    @RequestMapping("/helloIoc2")
    @ResponseBody
    public Object testSpringUtil1() {
        return IocC.getBean("iocA");
    }
}
